<?php
/*
	Copyright © Eleanor CMS
	URL: http://eleanor-cms.ru, http://eleanor-cms.com
	E-mail: support@eleanor-cms.ru
	Developing: Alexander Sunvas*
	Interface: Rumin Sergey
	=====
	*Pseudonym
*/
#Настройки
$url=array_keys($GLOBALS['Eleanor']->modules['sections'],'question');
$url=reset($url);

#$url=array('russian'=>'новости','ukrainian'=>'новини','english'=>'question',''=>'question');#URL модуля. Может быть строкой
#Конец настроек

include_once dirname(__file__).'/block_calendar_question-funcs.php';
$conf=include dirname(__file__).'/config.php';
if(is_array($url))
	$url=Eleanor::FilterLangValues($url,Language::$main);

if(!isset(Eleanor::$Language[$conf['n']]))
	Eleanor::$Language->Load(dirname(__file__).'/lang_user-*.php',$conf['n']);

if($cdate=Eleanor::GetCookie($conf['n'].'-calendar') and preg_match('#^(\d{4})\D(\d{1,2})$#',$cdate,$ma)>0)
{	list(,$y,$m)=$ma;
	$y=(int)$y;
	$m=(int)$m;
}
else
{
	$y=idate('Y');
	$m=idate('n');
}

return'<script src="js/block_calendar.js"></script>'
	.QuestionCalendar($y,$m,GetQuestionDates($y,$m,$conf),$id=uniqid($conf['n']),$conf,$url)
	.'<script>/*<![CDATA[*/var '.$id.'=new Calendar("'.$url.'",'.$y.','.$m.',"#'.$conf['n'].'-calendar","'.$id.'");//]]></script>';
?>